TestCase
(
	'org.puremvc.js.patterns.proxy.ProxyTest'

,	{
		testNameAccessor: function ()
		{
			var proxyName= 'TestProxy'
			,	proxy= new Proxy(proxyName);
			
			assertSame('Expecting proxy.getProxyName() == TestProxy', proxy.getProxyName(), proxyName);
		}
		
	,	testDataAccessor: function ()
		{
			// TODO criticise test- redundant!!!!
			var proxy= new Proxy('colors')
			,	colors= ['red', 'green', 'blue']
			,	data
			
			proxy.setData(colors);
			
			data= proxy.getData();
			
			assertSame('Retrieved data and set data have same lenght', colors.length, data.length);
			
			for (var i= 0, n= data.length; i < n; i++)
			{
				assertSame('The array entry at data['+i+'] matches color['+i+']', data[i], colors[i]);
			}
		}
		
	,	testConstructor: function ()
		{
			var proxyName= 'colors'
			,	proxyData= ['red', 'green', 'blue']
			,	proxy= new Proxy(proxyName, proxyData)
			,	data= proxy.getData()
			
			// TODO criticise test- constructors can never return null!
			
			assertNotNull('Expecting proxy not null', proxy)
			assertSame('The proxy name was set correctly', proxyName, proxy.getProxyName());
			for (var i= 0, n= data.length; i < n; i++)
			{
				assertSame('The array entry at data['+i+'] matches proxyData['+i+']', data[i], proxyData[i]);
			}
		}
	}
);
